package se.webbzon.boltzmann.game.object.player.boltzmann;

import se.webbzon.boltzmann.game.character.CharacterException;
import se.webbzon.boltzmann.game.object.camera.GameCamera;
import se.webbzon.boltzmann.game.object.player.AbstractPlayerCharacter;
import se.webbzon.boltzmann.player.BoltzmannCharacter;
import se.webbzon.boltzmann.player.Player;
import se.webbzon.oschi01.worldarea.WorldArea;

public class BoltzmannPlayerCharacter extends AbstractPlayerCharacter {
	
	// The current fire bomb 
	FireBomb fireBomb;
	
	/*============================================================
	Constructors
	============================================================*/

	public BoltzmannPlayerCharacter(Player player, BoltzmannCharacter boltzmann)
			throws CharacterException {
		super(player, boltzmann);
	}
	
	/*============================================================
	Public Methods
	============================================================*/
	
	@Override public double getJumpSpeed() {
		return 5;
	}
	
	@Override public double getGroundSpeed() {
		return 2;
	}
	
	@Override public double getAirSpeed() {
		return 0.2;
	}

	@Override public double getWaterSpeed() {
		return 0.8;
	}

	@Override public double getFocusSpeed() {
		return 0.02;
	}

	@Override public void onFocusBegin() {
		WorldArea world = getWorld();
		final GameCamera camera = 
				world.findInstances(GameCamera.class).iterator().next();
		
		fireBomb = new FireBomb(this,camera);
		world.createInstance(fireBomb);
	}

	@Override public void onFocusEnd() {
		fireBomb.hurl();
	}

}
